/*!
 * \file GapEventMediaBearerSetupReq.h
 * \brief Event carrying message GapMediaBearerSetupRequest
 */

#ifndef MGW_GAP_EVENT_MEDIA_BEARER_SETUP_REQ_H
#define MGW_GAP_EVENT_MEDIA_BEARER_SETUP_REQ_H

#include "EventData.h"
#include "GapGlobals.h"
#include "GAP.pb.h"

namespace tsc
{
namespace mgw
{

using GatewayApplicationPart::GapMediaBearerSetupRequest;
using ProtocolsCommon::IpAddress;

/**
 * Serving Gateway requests setup of media bearer
 */
class GapEventMediaBearerSetupReq : public common::EventData
{
public:

    GapEventMediaBearerSetupReq(GapMediaBearerSetupRequest& setupReq) :
		EventData(GAP_MEDIA_BEARER_SETUP_REQ),
		mConnectionId(setupReq.connectionid()),
		mpClientAddress(0),
		mClientMediaPort(setupReq.clientmediaport()),
		mMediaItemId(setupReq.mediaitemid())
	{
        mpClientAddress = new IpAddress(setupReq.clientaddress());
	}

	virtual ~GapEventMediaBearerSetupReq()
	{
	    delete mpClientAddress;
	}

	IpAddress* getClientAddress() const
	{
		return mpClientAddress;
	}

    uint32_t getClientMediaPort() const
    {
        return mClientMediaPort;
    }

    uint32_t getConnectionId() const
    {
        return mConnectionId;
    }

    uint32_t getMediaItemId() const
    {
        return mMediaItemId;
    }

private:

    uint32_t mConnectionId;

    IpAddress* mpClientAddress;

    uint32_t mClientMediaPort;

    uint32_t mMediaItemId;
};

} // namespace mgw
} // namespace tsc

#endif // MGW_GAP_EVENT_MEDIA_BEARER_SETUP_REQ_H
